package main

func contains(small map[int]struct{}, window map[int]int) bool {
	for k := range small {
		if c := window[k]; c == 0 {
			return false
		}
	}
	return true
}

func shortestSeq(big []int, small []int) []int {
    sm := map[int]struct{}{}
	for _, v := range small {
		sm[v] = struct{}{}
	}
	window := map[int]int{}
	result := []int{}
	l := 0
	for r, v := range big {
		window[v]++
		for contains(sm, window) {
			if len(result) == 0 || r-l < result[1] - result[0]{
				result = []int{l, r}
			}
			v2 := big[l]
			l++
			window[v2]--
		}

	}
	return result
}

func main() {
	big := []int{7,5,9,0,2,1,3,5,7,9,1,1,5,8,8,9,7}
	small := []int{1, 5, 9}
	res := shortestSeq(big, small)
	println(res)
}